//
//  WFFarmCropHeaderView.m
//  WisdomFarm
//
//  Created by sky on 2017/11/13.
//  Copyright © 2017年 sky. All rights reserved.
//

#import "WFFarmCropHeaderView.h"

@implementation WFFarmCropHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self setup];
    }
    return self;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self setup];
    }
    return self;
}

- (void)setup {
    
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    self.iconView = [[UIImageView alloc] init];
    self.titleLabel = [[UILabel alloc] init];
    self.separatorLine = [[UIView alloc] init];
    
    [self.contentView addSubview:self.iconView];
    [self.contentView addSubview:self.titleLabel];
    [self.contentView addSubview:self.separatorLine];
    
    [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.mas_equalTo(15);
        make.left.offset(12);
        make.centerY.offset(0);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.iconView.mas_right).offset(3);
        make.centerY.offset(0);
    }];
    
    [self.separatorLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.offset(0);
        make.height.mas_equalTo(0);
    }];
    
    self.iconView.image = [UIImage imageNamed:@"home_edit_icon_crop"];
    self.titleLabel.font = SCFont(14);
    self.titleLabel.textColor = [UIColor textTitleColor];
    self.titleLabel.text = @"种植作物";
    self.separatorLine.backgroundColor = [UIColor contentBackgroundColor];
}

@end
